const validateUser = (req, res, next) => {
  const { name, email } = req.body;
  if (!name || !email) {
    return res.status(400).json({
      error: 'Name and email are required'
    });
  }
  next();
};

const validateLogin = (req, res, next) => {
  const { email, password } = req.body;
  if (!email || !password) {
    return res.status(400).json({
      error: '邮箱和密码不能为空'
    });
  }
  next();
};

module.exports = {
  validateUser,
  validateLogin
};